package com.example.spmyb.controller;

import com.example.spmyb.poji.User;
import com.example.spmyb.services.imp.UserServicesImp;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @create 2022-03-2022/3/12-20:55
 */
@Controller
public class UserController {
    @Autowired
    private UserServicesImp servicesImp;

    @RequestMapping("/getAllUser")
    public String getAll(Model model){
        List<User> users= servicesImp.getAllUser();
        model.addAttribute("users",users);

        return "index";
    }

}
